export const drawRect = (mouseTool: any) => {
  console.log('绘制矩形')
  mouseTool.rectangle({
    strokeColor: 'red',
    strokeOpacity: 0.5,
    strokeWeight: 2,
    fillColor: 'blue',
    fillOpacity: 0.2,
    strokeStyle: 'solid',
  })
}

// 绘制圆形
export const drawCircle = (mouseTool: any) => {
  console.log('绘制圆形')
  mouseTool.circle({
    strokeColor: "#FF33FF",
    strokeOpacity: 1,
    strokeWeight: 6,
    strokeOpacity: 0.2,
    fillColor: '#1791fc',
    fillOpacity: 0.4,
    // strokeStyle: 'solid',
    strokeStyle: 'dashed',
    strokeDasharray: [30, 10],
  })
}

// 绘制多边形
export const drawOther = (mouseTool: any) => {
  mouseTool.polygon({
    strokeColor: "#FF33FF",
    strokeOpacity: 1,
    strokeWeight: 4,
    strokeOpacity: 0.2,
    fillColor: '#1791fc',
    fillOpacity: 0.2,
    strokeStyle: "solid",
  })
}


/**
 * 停止绘制
 * 形参为true时，清除所有绘制的覆盖物
 * 形参为false时，仅仅停止绘制，不会清除覆盖物
 */
export const stopDrawAndClear = (mouseTool: any) => {
  mouseTool.close(true)
}